﻿@model StartStop.ServiceResources.StatOverView

<script src="@Url.Content("~/js/jquery-1.6.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/jquery.cycle.all.latest.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#slider').cycle({
            pager: '#slider-pager'
        });

        $('.activetab a').each(function () {
            var activeTab = $(this).parents('li').index();
            var paneVisible = $(this).parents('ul').next().children('div').eq(activeTab);
            paneVisible.show().siblings().hide();
        });

        $('.tabs a').click(function () {
            $(this).parents('li').addClass('activetab').siblings().removeClass('activetab');
            var activeTab = $(this).parent('li').index();
            var paneVisible = $(this).parents('ul').next().children('div').eq(activeTab);
            paneVisible.show().siblings().hide();
            return false;
        });

        $('.toggle').click(function () {
            $(this).parents('h3').siblings('.box-content').slideToggle('fast');
            $(this).toggleClass('closed');
            return false;
        })


    });
</script>
<div id="hero-wrap">
    <div id="hero" class="profile section group">
        <div id="user-profile" class="group">
            <!-- This should be the app logo -->
            @if (Model.AssociatedImage!=null)
            {
                if (Request.IsAuthenticated)
                { 
                <text> <a href="/Image/Upload/App/">
                    <img src="@Url.Content("~/images/icon_pr.png")" alt="" /></a>
                </text>
                }
                else
                {
                <img src="@Url.Content("~/images/icon_pr.png")" alt="" />
                }

            }
            else
            {
             
               <!-- if an image has been uploaded then it should go here -->

            }
            <p>
                Platform: <span>PS3</span></p>
            <p>
                Game: <span>@Model.Title</span></p>
        </div>
        <!-- /user-profile -->
        <ul id="user-stats">
            <li id="trophies">Trophies <span>@ViewBag.TrophyCount</span></li>
            <li id="friends">Users <span>@ViewBag.AppUsers</span></li>
            <li id="level"><span></span></li>
        </ul>
        <!-- /user-stats -->
    </div>
    <!-- /hero -->
</div>
<!-- /hero-wrap -->
<div id="profile-wrap">
    <div id="profile" class="section group">
         <table class="tbl" cellspacing="0">
            <tr>
                <th>
                    Trophy Name
                </th>
                <th>
                    Award Condition
                </th>
                <th>
                    Number of users with trophy
                </th>
                </tr>

               @foreach (var item in ViewBag.AppTrophies)
            {
                <tr>
                    <td>

                     
                        <a href="/Award/Trophy/@item.TrophyID">
                        <p>
                        <img src="/images/TrophyMedium.png" alt="@item.Description" />
                        </p>
                            @item.Name
                        </a>
                    </td>
                    <td>
                        @item.Description
                    </td>
                    <td>
                        @if (item.UserAwardedCount != null)
                        {
                            @item.UserAwardedCount
                        }
                    </td>
                </tr>
                    
            }


        </table>


        <!-- /group -->
    </div>
    <!-- /news -->
</div>
<!-- /news-wrap -->
